aay*_*tha 43 macos node.js npm meanjs
我在使用Windows很长一段时间后给自己买了一本mac书.
我正在努力研究我一直在研究的MeanJS项目.这样做npm install
对项目抛出错误
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/Aayush/Work/lishn/repo/lishn-alpha/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-darwin-x64/debug.node --module_name=debug --module_path=/Users/Aayush/Work/lishn/repo/lishn-alpha/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-darwin-x64' (1)
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
>
> npm ERR! v8-debug@0.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug@0.4.6 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls v8-debug
npm ERR! There is likely additional logging output above.
Run Code Online (Sandbox Code Playgroud)
我试过清除缓存.
我尝试用sudo
和安装node-pre-gyp--unsafe-perm
我还尝试重新安装一个MEAN项目,但同样的错误.
我似乎无法找到问题在这里.
Node Version - 5.0.0
NPM Version - 3.3.10
Run Code Online (Sandbox Code Playgroud)
Ann*_*nne 40
我尝试过升级node-gyp:
sudo npm install -g node-gyp
Run Code Online (Sandbox Code Playgroud)
它对我有用.
我在这里找到解决方案,希望它可以提供帮助.
这似乎是我的节点升级的问题。不过,我用以下方法解决了这个问题。
首先卸载cli,清除cashe,然后使用这些命令重新安装
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
然后安装node-pre-gyp
npm install -g node-pre-gyp
Run Code Online (Sandbox Code Playgroud)
重新启动终端并查看问题是否解决。
小智 5
经过很多努力,我遇到了同样的问题。这是因为 npm 版本与 gprc 版本不兼容。所以我们需要更新npm。
npm update
npm install
Run Code Online (Sandbox Code Playgroud)
好吧,经过一些调试后,以下依赖项正在使用旧版本touch
:
./node_modules/bower/node_modules/decompress-zip/package.json: "touch": "0.0.3"
./node_modules/bower/node_modules/lockfile/package.json: "touch": "0"
./node_modules/gulp-nodemon/node_modules/nodemon/package.json: "touch": "1.0.0",
./node_modules/gulp-nodemon/node_modules/touch/package.json: "touch": "./bin/touch.js"
./node_modules/nodemon/package.json: "touch": "~0.0.3",
Run Code Online (Sandbox Code Playgroud)
这样我就可以让meanJS 与节点5 一起工作了。
这是我运行的命令的历史记录:
git clone https://github.com/meanjs/mean.git
cd mean
nvm install 5
nvm use 5
npm install
which node-gyp
npm install -g node-pre-gyp
sudo xcodebuild -license
npm install
Run Code Online (Sandbox Code Playgroud)
遇到了一些问题,然后:
我添加了以下行:
#!/usr/bin/env node
到文件顶部./mean/node_modules/.bin/touch
进而:
npm install
Run Code Online (Sandbox Code Playgroud)
当然,也许可以在重试之前添加一个sudo rm -rf ./node_modules && npm cache clean
。
归档时间: |
|
查看次数: |
83646 次 |
最近记录: |