Npm无法找到Python 2.7并且ng卸载不起作用

时间:2019-01-29 12:18:21

标签: node.js npm

我有一个糟糕的清单,这些清单不适用于我的npm安装,并且我不知道为什么,因为自3个小时前起,一切都运转良好。

如果我尝试使用npm install,则会收到此输出。

Building: C:\Program Files\nodejs\node.exe C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\node-gyp\\bin\\node-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.8.0
gyp info using node@10.15.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python\n    at getNotFoundError (C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn EPERM
gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:358:11)
gyp ERR! stack     at spawn (child_process.js:538:9)
gyp ERR! stack     at PythonFinder.execFile (child_process.js:221:15)
gyp ERR! stack     at PythonFinder.checkPythonVersion (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\node-gyp\lib\configure.js:455:10)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\node-gyp\lib\configure.js:516:12)
gyp ERR! stack     at C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\graceful-fs\polyfills.js:285:20
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:155:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\usr\\Documents\\WorkSpaces\\myPrj\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\usr\Documents\WorkSpaces\myPrj\node_modules\node-sass
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
Build failed with error code: 7
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.10.0 (node_modules\node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.10.0 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

所以我尝试使用npm install --global --production Windows-build-tools重新安装Windows Build Tools,然后收到此输出。

> windows-build-tools@5.1.0 postinstall C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js

C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\os.js:53
                        throw resultError;
                        ^

Error: spawnSync powershell.exe ENOENT
    at Object.spawnSync (internal/child_process.js:982:20)
    at Object.spawnSync (child_process.js:601:24)
    at spawnSync (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:67:36)
    at Object.queryRegFromPowershell (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:73:3)
    at loop (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:113:16)
    at opts.shift (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:116:7)
    at spawn (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:100:5)
    at spawnSync (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:68:2)
    at Object.queryRegFromRegExe (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:96:3)
    at loop (C:\Users\usr\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:113:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@5.1.0 postinstall: `node ./dist/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@5.1.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\usr\AppData\Roaming\npm-cache\_logs\2019-01-29T12_11_19_973Z-debug.log

我尝试在PATH变量中添加路径%SystemRoot%/ system32 / WindowsPowerShell / v1.0,但不进行任何更改。

0 个答案:

没有答案