錯(cuò)誤代碼:
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:Users***AppDataRoami
ngnpmnode_modulesnode-sassnode_modulesnode-gyplibconfigure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:Users***AppDataRoamin
gnpmnode_modulesnode-sassnode_modulesnode-gyplibconfigure.js:508:16)
gyp ERR! stack at C:Users***AppDataRoamingnpmnode_modulesnode-sa
ssnode_modulesgraceful-fspolyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "D:\Program Files\nodejs\node.exe" "C:\Users\*\App
Data\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\bin\node-g
yp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldf
lags=" "--libsass_library="
gyp ERR! cwd C:Users***AppDataRoamingnpmnode_modulesnode-sass
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:Users***AppDataRoamingnpm-cache_logs2017-07-06T01_07_
47_983Z-debug.log
求大佬指點(diǎn),給大佬遞茶。公司內(nèi)網(wǎng),代理已經(jīng)配置好,不過我的權(quán)限可能有的網(wǎng)站和端口會(huì)訪問不了,github能上,node.js官網(wǎng)能上,源用的是cnpm。
ringa_lee
Create a file named .npmrc in the same directory as package.json, and then install python, preferably version 2.X
Put the following sentence in it
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
The prompt is that you need to install python. You can install python and try it, then set the PYTHON environment variable and reinstall it.
Create .npmrc in the root directory
phantomjs_cdnurl=http://cnpmjs.org/downloads
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org
After saving, re-npm install
I also tried to install nodesass yesterday and it failed. Later I switched to Taobao mirror and installed it successfully
$ npm install -g cnpm --registry=https://registry.npm.taobao.org (install Taobao mirror)
$ cnpm install node-sass --save (use Taobao image to install node-sass)