简体   繁体   English

找不到 npx 命令。 对于 reactJS

[英]npx command not found. For reactJS

I am trying to install react-web .我正在尝试安装react-web

Running the command运行命令

npx create-react- app .

It tells me 它告诉我

npx command not found.找不到npx命令。 This haven't happen earlier.这还没有发生过。

Then I run npx -v然后我运行npx -v

Again the same error:同样的错误:

'npx command not found' . '找不到 npx 命令'

I decide to install npx.我决定安装npx。 I run sudo npm i -g npx And this is what I get(refer the picture) enter image description here .我运行sudo npm i -g npx这就是我得到的(参考图片)在此处输入图像描述 How do I tackle this?我该如何解决这个问题?

Try this:尝试这个:

  1. verify node is install.验证node是否安装。 Try running node -v尝试运行node -v
  2. Add node to environment variables.node添加到环境变量。

Incase you have node version less than 5.2, consider updating or installing npx as:如果您的node版本低于 5.2,请考虑将npx更新或安装为:

npm i -g npx

Ok.好的。 I did it finally.我终于做到了。

Here are the steps I had to follow.这是我必须遵循的步骤。

  1. Open the terminal.打开终端。
  2. cd into /usr/local/bin/ cd 进入/usr/local/bin/
  3. ls the directory ls目录
  4. Will find an npx file.会找到一个 npx 文件。
  5. (remove this file) sudo rm -i npx (删除此文件) sudo rm -i npx
  6. (re-install npx) sudo npm i -g npx (重新安装 npx) sudo npm i -g npx
  7. Done!完毕!

Hope it helps someone in need.希望能帮到有需要的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “没有找到与模式“src”匹配的文件。” 使用“npx eslint src”或“npx eslint src/”时 - "No files matching the pattern "src" were found." when using "npx eslint src" or "npx eslint src/" 没有找到匹配的文件...。 (ReactJS) - No matching files ... were found. (ReactJS) 未找到创建 reactjs 应用程序的命令 - Create reactjs application Command not found GSAP 和 ReactJs。 控制台警告:未找到 GSAP 目标未定义。 & 未找到 GSAP 目标 - GSAP & ReactJs. Console warnings: GSAP target undefined not found. & GSAP target not found 为什么在终端中通过类型“npx create-react-app my-app”显示“找不到命令”? - Why is displaying 'command not found' by type 'npx create-react-app my-app' in terminal? 我得到 NPX: command not found 每当我运行 create-react-app - I get NPX: command not found whenever I run create-react-app 我无法使用 npx 创建 React Native 项目:react-native: command not found - I can't create React Native project with npx: react-native: command not found package.json HTTPS=true 导致“命令“HTTPS”拼写错误或找不到。” - package.json HTTPS=true causes "The command "HTTPS" is either misspelled or could not be found." 无法启动 reactJS 服务器 | 错误:“rbenv:纱线:找不到命令” - Cannot start reactJS server | error: "rbenv: yarn: command not found" npx create-react-app 命令不起作用 - npx create-react-app command is not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM