【发布时间】:2020-04-02 13:50:21
【问题描述】:
【问题讨论】:
-
它没有在the NPM page 中暗示它有一个 CLI 脚本(不是所有的包都有 - 在
./node_modules/.bin中有什么东西吗?)并且this tutorial 建议从特定的@987654326 运行它@ 文件。我不清楚你为什么认为这会奏效。
标签: javascript node.js reactjs npm npm-start
【问题讨论】:
./node_modules/.bin 中有什么东西吗?)并且this tutorial 建议从特定的@987654326 运行它@ 文件。我不清楚你为什么认为这会奏效。
标签: javascript node.js reactjs npm npm-start
您在“脚本”中看到的任何内容都是当您键入 npm script keyword here 时将运行的内容。
npm start 在您的实例中 - 正在运行 server。这不是命令。
您需要做的是将值从server 更改为node server.js 或node your_file.js。
祝你在学习冒险中好运。
【讨论】:
如果您之前通过npm install -g create-react-app 全局安装了create-react-app,我建议您使用npm uninstall -g create-react-app 卸载该软件包,以确保npx 始终使用最新版本。
然后删除完整目录 在你的命令行中运行
npx create-react-app react-app
cd react-app
npm start
【讨论】: