如何将python放入path-Ubuntu 20 npm安装失败

如何将python放入path-Ubuntu 20 npm安装失败,python,ubuntu,npm,Python,Ubuntu,Npm,我正在重新安装Ubuntu 20 我用nvm安装了npm 现在,当我运行npm安装时,我得到了关于python的这个错误 > onfigure [] gyp verb check python checking for Python executable > ":/usr/bin/python" in the PATH gyp verb `which` failed Error: not > found: :/usr/bin/python gyp verb

我正在重新安装Ubuntu 20 我用nvm安装了npm 现在,当我运行npm安装时,我得到了关于python的这个错误

> onfigure [] gyp verb check python checking for Python executable
> ":/usr/bin/python" in the PATH gyp verb `which` failed Error: not
> found: :/usr/bin/python gyp verb `which` failed     at
> getNotFoundError (/var/www/forum/node_modules/which/which.js:13:12)
> gyp verb `which` failed     at F
> (/var/www/forum/node_modules/which/which.js:68:19) gyp verb `which`
> failed     at E (/var/www/forum/node_modules/which/which.js:80:29) gyp
> verb `which` failed     at
> /var/www/forum/node_modules/which/which.js:89:16 gyp verb `which`
> failed     at /var/www/forum/node_modules/isexe/index.js:42:5 gyp verb
> `which` failed     at /var/www/forum/node_modules/isexe/mode.js:8:5
> gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21)
> gyp verb `which` failed  :/usr/bin/python Error: not found:
> :/usr/bin/python gyp verb `which` failed     at getNotFoundError
> (/var/www/forum/node_modules/which/which.js:13:12) gyp verb `which`
> failed     at F (/var/www/forum/node_modules/which/which.js:68:19) gyp
> verb `which` failed     at E
> (/var/www/forum/node_modules/which/which.js:80:29) gyp verb `which`
> failed     at /var/www/forum/node_modules/which/which.js:89:16 gyp
> verb `which` failed     at
> /var/www/forum/node_modules/isexe/index.js:42:5 gyp verb `which`
> failed     at /var/www/forum/node_modules/isexe/mode.js:8:5 gyp verb
> `which` failed     at FSReqCallback.oncomplete (fs.js:168:21) { gyp
> verb `which` failed   code: 'ENOENT' gyp verb `which` failed } gyp
> ERR! configure error  gyp ERR! stack Error: Can't find Python
> executable ":/usr/bin/python", you can set the PYTHON env variable.
> gyp ERR! stack     at PythonFinder.failNoPython
> (/var/www/forum/node_modules/node-gyp/lib/configure.js:484:19) gyp
> ERR! stack     at PythonFinder.<anonymous>
> (/var/www/forum/node_modules/node-gyp/lib/configure.js:406:16) gyp
> ERR! stack     at F (/var/www/forum/node_modules/which/which.js:68:16)
> gyp ERR! stack     at E
> (/var/www/forum/node_modules/which/which.js:80:29) gyp ERR! stack    
> at /var/www/forum/node_modules/which/which.js:89:16 gyp ERR! stack    
> at /var/www/forum/node_modules/isexe/index.js:42:5 gyp ERR! stack    
> at /var/www/forum/node_modules/isexe/mode.js:8:5 gyp ERR! stack     at
> FSReqCallback.oncomplete (fs.js:168:21) gyp ERR! System Linux
> 5.4.0-42-generic gyp ERR! command "/home/alex/.nvm/versions/node/v12.18.3/bin/node"
> "/var/www/forum/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
> "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags="
> "--libsass_library=" gyp ERR! cwd
> /var/www/forum/node_modules/node-sass gyp ERR! node -v v12.18.3 gyp
> ERR! node-gyp -v v3.8.0 gyp ERR! not ok  Build failed with error code:
> 1 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2
> (node_modules/chokidar/node_modules/fsevents): npm WARN notsup
> SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3:
> wanted {"os":"darwin","arch":"any"} (current:
> {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL
> DEPENDENCY: fsevents@^1.0.0
> (node_modules/laravel-mix/node_modules/chokidar/node_modules/fsevents):
> npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
> fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current:
> {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL
> DEPENDENCY: fsevents@^1.2.7
> (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
> npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
> fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current:
> {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL
> DEPENDENCY: fsevents@^1.2.7
> (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
> npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
> fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current:
> {"os":"linux","arch":"x64"}) npm WARN ajv-keywords@3.5.2 requires a
> peer of ajv@^6.9.1 but none is installed. You must install peer
> dependencies yourself. npm WARN eslint-config-google@0.9.1 requires a
> peer of eslint@>=4.1.1 but none is installed. You must install peer
> dependencies yourself.
> 
> npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.9.2
> postinstall: `node scripts/build.js` npm ERR! Exit status 1 npm ERR! 
> npm ERR! Failed at the node-sass@4.9.2 postinstall script. npm ERR!
> This is probably not a problem with npm. There is likely additional
> logging output above.
,除了跑步,我什么也得不到

whereis python
我明白了

当我运行python时,它运行正常

python
Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0] on linux

似乎有一些依赖性的问题 看看这个,
此外,它可能需要python2而不是3

尝试将python别名为Python2.7而不是Python3,

可以,谢谢。我必须这么做
python: /usr/bin/python3.8 /usr/bin/python /usr/lib/python2.7 /usr/lib/python3.8 /etc/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8
python
Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0] on linux