我无法在名为 phaser3-project-template 的 git bash 文件夹中安装 npm 或 node js

Posted

技术标签:

【中文标题】我无法在名为 phaser3-project-template 的 git bash 文件夹中安装 npm 或 node js【英文标题】:I can't install npm or node js in my git bash folder named phaser3-project-template 【发布时间】:2021-09-08 06:35:47 【问题描述】:

每当我在我的 git bash 终端中输入 npm install 时,都会出现一个错误提示

> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\Bea Beangca\Desktop\phaser\phaser3-project-template\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js

'node' is not recognized as an internal or external command,
operable program or batch file.
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 ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: `node lib/post_install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 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\Bea Beangca\AppData\Roaming\npm-cache\_logs\2021-09-08T06_30_15_228Z-debug.log

当我在我的 git bash 终端中输入ls 时,它会显示我下载了node_modules

$ ls
LICENSE  README.md  assets/  build/  index.html  node_modules/  package-lock.json  package.json  src/  webpack.config.js

$ npm run start

> phaser3-project-template@1.0.9 start C:\Users\Bea Beangca\Desktop\phaser\phaser3-project-template
> npm run build && webpack-dev-server --port=8000

'npm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phaser3-project-template@1.0.9 start: `npm run build && webpack-dev-server --port=8000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phaser3-project-template@1.0.9 start 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\Bea Beangca\AppData\Roaming\npm-cache\_logs\2021-09-08T06_34_12_381Z-debug.log

【问题讨论】:

***.com/q/23412938/11912 有帮助吗? 【参考方案1】:

您的 git bash 似乎没有安装节点。我只是这么认为,因为它说npm is not recognized as an internal or external command

如果我是正确的,我相信您的解决方案是安装 nvm 或 nodejs。您使用的是 Windows 吗?

【讨论】:

欢迎来到 Stack Overflow!请将其表述为有条件的解释性答案,以避免给人一种提出澄清问题而不是回答的印象(应该使用评论而不是答案,比较 meta.stackexchange.com/questions/214173/… )。例如像“如果你的问题是......那么解决方案是......因为......。” 这没有提供问题的答案。一旦你有足够的reputation,你就可以comment on any post;相反,provide answers that don't require clarification from the asker。 - From Review

以上是关于我无法在名为 phaser3-project-template 的 git bash 文件夹中安装 npm 或 node js的主要内容,如果未能解决你的问题,请参考以下文章

无法取消归档名为 stackview 的元素

JPA/Hibernate 无法创建名为 Order 的实体

ImportError:没有名为 pydot 的模块(无法导入 pydot)

NSInvalidUnarchiveOperationException:“无法实例化名为 _UITableViewCellSeparatorView 的类”

错误:NSInvalidUnarchiveOperationException:无法实例化名为 NSLayoutConstraint 的类

一个组件需要一个名为 '' 的 bean,但无法找到