您的位置:首页技术文章
文章详情页

javascript - npm install 报错,求解

【字号: 日期:2023-09-15 18:08:39浏览:32作者:猪猪

问题描述

npm WARN prefer global node-gyp@3.6.0 should be installed with -g> node-sass@4.5.2 install D:githubVueBlognode_modulesnode-sass> node scripts/install.jsDownloading binary from https://github.com/sass/node-sass/releases/download/v4.5.2/win32-x64-48_binding.nodeCannot download 'https://github.com/sass/node-sass/releases/download/v4.5.2/win32-x64-48_binding.node':connect ETIMEDOUT 54.231.72.27:443Timed out whilst downloading the prebuilt binaryHint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g. export HTTP_PROXY=http://example.com:1234or configure npm proxy via npm config set proxy http://example.com:8080> node-sass@4.5.2 postinstall D:githubVueBlognode_modulesnode-sass> node scripts/build.jsBuilding: E:软件node.jsnode.exe D:githubVueBlognode_modulesnode-gypbinnode-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=gyp info it worked if it ends with okgyp verb cli [ ’E:软件node.jsnode.exe’,gyp verb cli ’D:githubVueBlognode_modulesnode-gypbinnode-gyp.js’,gyp verb cli ’rebuild’,gyp verb cli ’--verbose’,gyp verb cli ’--libsass_ext=’,gyp verb cli ’--libsass_cflags=’,gyp verb cli ’--libsass_ldflags=’,gyp verb cli ’--libsass_library=’ ]gyp info using node-gyp@3.6.0gyp info using node@6.9.4 | win32 | x64gyp verb command rebuild []gyp verb command clean []gyp verb clean removing 'build' directorygyp verb command configure []gyp verb check python checking for Python executable 'python2' in the PATHgyp verb `which` failed Error: not found: python2gyp verb `which` failed at getNotFoundError (D:githubVueBlognode_moduleswhichwhich.js:13:12)gyp verb `which` failed at F (D:githubVueBlognode_moduleswhichwhich.js:68:19)gyp verb `which` failed at E (D:githubVueBlognode_moduleswhichwhich.js:80:29)gyp verb `which` failed at D:githubVueBlognode_moduleswhichwhich.js:89:16gyp verb `which` failed at D:githubVueBlognode_modulesisexeindex.js:42:5gyp verb `which` failed at D:githubVueBlognode_modulesisexewindows.js:36:5gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15)gyp verb `which` failed python2 { Error: not found: python2gyp verb `which` failed at getNotFoundError (D:githubVueBlognode_moduleswhichwhich.js:13:12)gyp verb `which` failed at F (D:githubVueBlognode_moduleswhichwhich.js:68:19)gyp verb `which` failed at E (D:githubVueBlognode_moduleswhichwhich.js:80:29)gyp verb `which` failed at D:githubVueBlognode_moduleswhichwhich.js:89:16gyp verb `which` failed at D:githubVueBlognode_modulesisexeindex.js:42:5gyp verb `which` failed at D:githubVueBlognode_modulesisexewindows.js:36:5gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15) code: ’ENOENT’ }gyp verb check python checking for Python executable 'python' in the PATHgyp verb `which` failed Error: not found: pythongyp verb `which` failed at getNotFoundError (D:githubVueBlognode_moduleswhichwhich.js:13:12)gyp verb `which` failed at F (D:githubVueBlognode_moduleswhichwhich.js:68:19)gyp verb `which` failed at E (D:githubVueBlognode_moduleswhichwhich.js:80:29)gyp verb `which` failed at D:githubVueBlognode_moduleswhichwhich.js:89:16gyp verb `which` failed at D:githubVueBlognode_modulesisexeindex.js:42:5gyp verb `which` failed at D:githubVueBlognode_modulesisexewindows.js:36:5gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15)gyp verb `which` failed python { Error: not found: pythongyp verb `which` failed at getNotFoundError (D:githubVueBlognode_moduleswhichwhich.js:13:12)gyp verb `which` failed at F (D:githubVueBlognode_moduleswhichwhich.js:68:19)gyp verb `which` failed at E (D:githubVueBlognode_moduleswhichwhich.js:80:29)gyp verb `which` failed at D:githubVueBlognode_moduleswhichwhich.js:89:16gyp verb `which` failed at D:githubVueBlognode_modulesisexeindex.js:42:5gyp verb `which` failed at D:githubVueBlognode_modulesisexewindows.js:36:5gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15) code: ’ENOENT’ }gyp verb could not find 'python'. checking python launchergyp verb could not find 'python'. guessing locationgyp verb ensuring that file exists: C:Python27python.exegyp ERR! configure errorgyp ERR! stack Error: Can’t find Python executable 'python', you can set the PYTHON env variable.gyp ERR! stack at Object.failNoPython (D:githubVueBlognode_modulesnode-gyplibconfigure.js:482:19)gyp ERR! stack at Object.<anonymous> (D:githubVueBlognode_modulesnode-gyplibconfigure.js:508:16)gyp ERR! stack at D:githubVueBlognode_modulesgraceful-fspolyfills.js:284:29gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)gyp ERR! System Windows_NT 10.0.14393gyp ERR! command 'E:软件node.jsnode.exe' 'D:githubVueBlognode_modulesnode-gypbinnode-gyp.js' 'rebuild' '--verbose' '--libsass_ext=' '--libsass_cflags=' '--libsass_ldflags=' '--libsass_library='gyp ERR! cwd D:githubVueBlognode_modulesnode-sassgyp ERR! node -v v6.9.4gyp ERR! node-gyp -v v3.6.0gyp ERR! not ok

javascript - npm install 报错,求解

问题解答

回答1:

npm install -g cnpm --registry=https://registry.npm.taobao.orgcnpm node-sass --save-dev回答2:

node-sass 无法正常下载,国内下载好像网络不是很好,可以使用cnpm(淘宝源)下载

回答3:

node有没有全局安装 / node版本是不是最新 / npm版本是不是最新

回答4:

提问前先搜索下,参考我的回答

回答5:

代码提示了不是么。一个是少了-g,还有sass那么下不下来,超时了。改cnpm

标签: JavaScript
相关文章: