【发布时间】:2020-07-12 20:40:33
【问题描述】:
╰─ npm run dev
> nextjspractise@0.1.0 dev /home/auura/D:drive/React/nextjspractise
> next dev
sh: 1: next: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! nextjspractise@0.1.0 dev: `next dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the nextjspractise@0.1.0 dev 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! /home/auura/.npm/_logs/2020-04-01T06_32_26_968Z-debug.log
package.json 文件
{
"name": "nextjspractise",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"axios": "^0.19.2",
"next": "9.3.2",
"react": "^16.13.1",
"react-dom": "^16.13.1"
}
}
当我尝试使用 npm run dev 安装 nextjs 包和脚本后,我的本地包无法正常工作,即使 package.json 包含与 node_modules 相同的所有包,然后也找不到包的错误
如果我在全局安装下一个 react react-dom 包,则 npm run dev 命令执行正常,但本地包不起作用
本地包不工作 操作系统:Ubuntu 18.04.4
【问题讨论】: