【发布时间】:2018-11-05 16:10:43
【问题描述】:
我正在使用:
Windows 10
npm -v 5.8.0
npx -v 9.7.1
运行npx 时,我得到:"The "path" argument must be of type string"。
我正在尝试创建一个 React 应用程序。得到这个错误:
λ npx create-react-app myapp
npx: installed 1 in 4.576s
The "path" argument must be of type string
C:\Users\MyUser\AppData\Roaming\npm\node_modules\create-react-app\index.js
C:\Users\MyUser\AppData\Roaming\npm\node_modules\create-react-app\package.json: Unexpected string in JSON at position 52
【问题讨论】:
-
你能告诉我们你的
package.json文件是什么样的吗? -
我已经安装了 npm i create-react-app
-
尝试新版本的 node.js/npm,我在切换到旧的 node.js 版本时遇到了类似的问题。