安装weex-toolkit后,执行:weex 报错
/usr/local/lib/node_modules/weex-toolkit/node_modules/._xtoolkit@0.2.7@xtoolkit/src/package/NpmPackage.js:50
throw new Error('resolve path error:'+this.path)
^
Error: resolve path error:/usr/local/lib/node_modules/weex-toolkit/node_modules/._weex-previewer
at NpmPackage.resolve (/usr/local/lib/node_modules/weex-toolkit/node_modules/._xtoolkit@0.2.7@xtoolkit/src/package/NpmPackage.js:50:23)
at Command.run (/usr/local/lib/node_modules/weex-toolkit/node_modules/._xtoolkit@0.2.7@xtoolkit/src/Command.js:43:13)
at XToolkit._done (/usr/local/lib/node_modules/weex-toolkit/node_modules/._xtoolkit@0.2.7@xtoolkit/src/xtoolkit.js:149:36)
at process.nextTick (/usr/local/lib/node_modules/weex-toolkit/node_modules/._xtoolkit@0.2.7@xtoolkit/src/xtoolkit.js:90:22)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:538:3
解决方案:
卸载npm重新安装:
npm uninstall npm -g 报错:
npm ERR! Maximum call stack size exceeded
切换管理权限再次卸载成功:
sudo npm uninstall npm -g
下载node.js安装包 重新安装:
然后再次安装weex-toolkit
npm install -g weex-toolkit
安装成功后,你输入weex应该可以看到下面的提示效果;
参考链接:https://github.com/npm/npm