javascript - npm install 報錯,求解
問題描述
npm WARN prefer global [email protected] should be installed with -g> [email protected] 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> [email protected] 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 [email protected] info using [email protected] | 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. angular.js - 在終端中用yeoman啟用angular-generator報錯,求解?2. angular.js - angular2 基礎問題,求解答3. javascript - 使用vue-cli報錯,搞不清求解4. mysql - 數據庫字段命名問題,新人,求解5. javascript - 小白求解:mac 下如何設置nodejs express的 NODE_NEV 環境變量6. python-pip - win10下python版本切換pip為python2.7安裝的庫python3不能用,求解,怎么能自由切換Python版本7. 我和老師的代碼對照了幾遍沒發現問題,但是瀏覽器打開就有問題了,求解8. mysql啟動失敗,求解9. 數據庫無法插入,求解答,謝謝10.排行榜java - 關于 controller層與service層如何傳值? 1. 怎么用css截取字符? 2. mysql里的大表用mycat做水平拆分,是不是要先手動分好,再配置mycat 3. javascript - 關于圣杯布局的一點疑惑 4. javascript - koa中讀取文件應該怎么寫 5. jquery - js文件被多次加載問題 6. dockerfile - docker-compose啟動lnmp失敗? 7. android-studio - Android studio中的這個框如何用快捷鍵打開? 8. angular.js - angularjs ng-class指令改變ng-click點擊的class屬性失效 9. android - libGDX 顯示ttf字體出錯 10. javascript - yarn npm和cpmp