100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > npm install 错误问题 gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Users\Zhan

npm install 错误问题 gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Users\Zhan

时间:2020-02-04 04:00:05

相关推荐

npm install 错误问题 gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Users\Zhan

刚开始使用vscode打开一个已写好的vue。

1.根据网上教程,下载并配置好nodejs

2.利用vscode打开已有vue文件

3.使用命令行,输入

npm install

4.然后就报出如下错误

localhost:react-first changwei$ npm install --save react-routernpm WARN deprecated core-js@1.2.7: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.> fsevents@1.2.4 install /Users/changwei/project/react-first/node_modules/fsevents> node installnode-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.4 and node@11.12.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp) gyp ERR! configure error gyp ERR! stack Error: Command failed: /Users/changwei/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];gyp ERR! stack File "<string>", line 1gyp ERR! stackimport sys; print "%s.%s.%s" % sys.version_info[:3];gyp ERR! stack ^gyp ERR! stack SyntaxError: invalid syntaxgyp ERR! stack gyp ERR! stackat ChildProcess.exithandler (child_process.js:297:12)gyp ERR! stackat ChildProcess.emit (events.js:197:13)gyp ERR! stackat maybeClose (internal/child_process.js:988:16)gyp ERR! stackat Socket.stream.socket.on (internal/child_process.js:404:11)gyp ERR! stackat Socket.emit (events.js:197:13)gyp ERR! stackat Pipe._handle.close (net.js:611:12)gyp ERR! System Darwin 17.7.0gyp ERR! command "/usr/local/Cellar/node/11.12.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/changwei/project/react-first/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/changwei/project/react-first/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64" "--napi_version=4" "--node_abi_napi=napi"gyp ERR! cwd /Users/changwei/project/react-first/node_modules/fseventsgyp ERR! node -v v11.12.0gyp ERR! node-gyp -v v3.8.0gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/11.12.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/changwei/project/react-first/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/Users/changwei/project/react-first/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi' (1)node-pre-gyp ERR! stackat ChildProcess.<anonymous> (/Users/changwei/project/react-first/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)node-pre-gyp ERR! stackat ChildProcess.emit (events.js:197:13)node-pre-gyp ERR! stackat maybeClose (internal/child_process.js:988:16)node-pre-gyp ERR! stackat Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)node-pre-gyp ERR! System Darwin 17.7.0node-pre-gyp ERR! command "/usr/local/Cellar/node/11.12.0/bin/node" "/Users/changwei/project/react-first/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"node-pre-gyp ERR! cwd /Users/changwei/project/react-first/node_modules/fseventsnode-pre-gyp ERR! node -v v11.12.0node-pre-gyp ERR! node-pre-gyp -v v0.10.0node-pre-gyp ERR! not ok

感觉像是python找不到,或者py的版本不对

5.解决以上报错

卸载并重新安装、配置 nodejs

********实测有效!

备注:npm install没问题后,再npm run dev还是报错,运行不起来,看一下错误。一般应该是Cannot find module 'node-sass‘,然后按照网上教程再操作一下,就可以了。

友情链接('node-sass‘):/com_it/article/details/95043471

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。