问题标签 [npx]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1648 浏览

react-native - 在终端中编写命令时何时使用 expo、npm 和 yarn?

这个问题有两个部分:

  1. 我最近开始研究 react-native,我很难理解我们在哪里使用 npm、expo、npx 或 yarn。我正在使用 mac 机器并尝试在 ios 模拟器上运行我的应用程序。

  2. 如果我在全局安装 react-native,我是否在创建时在每个项目中独立地需要它。

0 投票
5 回答
5697 浏览

javascript - npx react-native init 错误在 appdata 文件夹中不包含 package.json 文件

当我使用常规 npm 或 npx 命令时

或者

没有错误,但是对于我使用时的反应原生项目

它显示了这个错误:

我该如何解决这个错误?

0 投票
1 回答
190 浏览

javascript - React Native 最小/准系统设置

当我创建一个新的 React Native 项目时npx react-native init <Project name>

我注意到有很多“未使用”的样板、prettierrc等等。

是否有用于使用 React Native 进行准系统/最小锅炉设置的“首选”模板?为了获得一个“干净”的项目启动基地。

0 投票
1 回答
1132 浏览

node.js - 无法启动 React 项目

请找到我在终端中得到的错误日志

请查找调试错误日志

此外,我已经尝试过这些建议:

  1. 删除节点模块package-lock.json
  2. 然后运行命令:npm update
  3. 然后运行命令:npm install
  4. 当我运行npm start时,我得到了与上面相同的错误

我注意到的另一件事是,每当我新安装一个 React 应用程序时,我通常会获取 App.js、index.js、index.html 甚至是 src 文件夹,但我并没有得到所有这些。请帮忙!

0 投票
1 回答
5103 浏览

react-native - 警告:componentWillReceiveProps 已重命名,不推荐使用

我用createBottomTabNavigator.

在我的课上

这是我的 package.json

这是我的错误

我做了npx react-codemod rename-unsafe-lifecycles,但没有用。

0 投票
1 回答
321 浏览

node.js - 运行npm run dev时编译失败如何解决?

我运行时收到此结果...npm run dev

请帮我解决这个问题。

0 投票
2 回答
2101 浏览

node.js - 在 create-react-app 安装期间遇到问题

我正在尝试学习如何使用 React,但我遇到了 create-react-app 的问题:https ://create-react-app.dev/docs/getting-started/

我在使用的安装过程中遇到了问题

按照教程中的建议。

我所做的npx create-react-app my-app只是我从终端得到的错误是

我试图寻找修复,但它建议使用 sudo chown -R $USER /usr/local/lib/node_modules

我该如何解决这个问题?

0 投票
1 回答
1536 浏览

npx - 运行npx时如何传递内联选项?

在不更改工作站的全局 npm 配置或在当前目录中创建.npmrc文件的情况下,我想使用私有 nexus 注册表运行 npx 包。

那么,是否可以使用 和 等内联选项运行命令npx(最好是跨平台)?就像是:registrystrict-ssl

我在 PowerShell/Windows 上尝试了上面的代码片段,但我的注册表没有被命中,它仍然试图访问默认注册表 ( https://registry.npmjs.org )。

0 投票
5 回答
7167 浏览

react-native - 无法运行程序“npx”:错误=2,运行 React Native 应用程序时没有这样的文件或目录

我一直react-native在另一台电脑上处理项目,它一直在正常工作。现在我将项目克隆到另一个我react-native安装的设备,因为我使用其他项目并且我无法运行它。

当我运行时,react-native run-android我收到此错误:

无法运行程序“npx”:错误=2,没有这样的文件或目录

0 投票
2 回答
1588 浏览

node.js - I can't get react up and running. When i type npm start then it gives me an error

As you can see i get this error. Has it something to do with my package.json? Default looks like this.

After i did the command npm rm -g create-react-app i get the following in the command prompt