javascript - npm install 报错,求解
问题描述
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
问题解答
回答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
相关文章:
1. javascript - 小白求解:mac 下如何设置nodejs express的 NODE_NEV 环境变量2. java - 更新到IntelliJ IDEA2017.1后,遇到问题,求解!3. angular.js - angular2 基础问题,求解答4. html - 手机上css3翻转有BUG,求解5. node.js - 利用vue-cli 构建执行到npm run dev 报错,求解~6. 用命令无法登陆mysql页面求解答7. javascript - vue报错,昨天也是这么写的也没报错呀,今天就报错了,不知原因。求解决8. javascript - ie11以下单击打开不了file,双击可以。求解?9. javascript - 关于类的一个小问题,求解答?10. python - 在线等,大神求解答下这个机器返回的数据应该怎么处理呢