英文:
NX @nrwl/node generator error "Cannot find module 'nx/src/utils/code-frames"
问题
我正在尝试使用 @nrwl/node
生成一个新的节点项目,但当我使用生成器时,遇到以下错误:
NX 找不到模块 'nx/src/utils/code-frames'
这导致我无法运行生成器。
我的 nx 版本是 15.2.1,
我的 @nrwl/node 版本是 15.9.2,
我的 node 版本是 16.17.0。
我已多次尝试重新安装包,但没有成功。
英文:
I am attempting to generate a new node project using @nrwl/node
and when I use the generator I am met with the error
NX Cannot find module 'nx/src/utils/code-frames'
inhibiting me from running the generator.
my nx version is 15.2.1
my @nrwl/node version is 15.9.2
and my node version is 16.17.0
Ive attempted to reinstall the packages multiple times to no avail.
答案1
得分: 6
nx
和 @nrwl/node
必须处于相同的版本。如果在较新的版本上运行 nx workspace-lint
(在其被弃用之前)或在 nx report
过程中,您应该会看到错误。
nx migrate latest
可以将事物同步回原来的状态。
英文:
nx
and @nrwl/node
must be at the same version. You should see an error if you run nx workspace-lint
(prior to its deprecation), or during nx report
on newer versions.
nx migrate latest
would get things synced back up.
答案2
得分: 2
运行 nx report
你将会得到如下结果:
> NX 一些包的版本不匹配!这些包应该与你安装的 Nx 版本匹配。
> - @nrwl/angular@15.9.3
> - @nrwl/cypress@15.6.3
> - @nrwl/js@15.6.3
> - @nrwl/react@15.9.3
> - @nrwl/webpack@15.6.3 你可以通过运行 nx migrate 15.9.3
来解决这个问题。
运行 nx migrate 15.9.3
然后 运行 Yarn
或 NPM i
冲突将被解决
英文:
Run nx report
You will get results like the following:
> NX Some packages have misaligned versions! These packages should
> match your installed version of Nx.
> - @nrwl/angular@15.9.3
> - @nrwl/cypress@15.6.3
> - @nrwl/js@15.6.3
> - @nrwl/react@15.9.3
> - @nrwl/webpack@15.6.3 You should be able to fix this by running nx migrate 15.9.3
Running nx migrate 15.9.3
Then Yarn
or NPM i
The conflict will be solved
答案3
得分: 0
@nrwl/webpack": "^15.0.13"
我有这个,但我的其他包没有^
,像这样
"@nrwl/webpack": "15.0.13"
迁移工具识别到这一点,但没有修复。所以,确保你的版本不仅在数字上匹配,而且在版本方案或称为其他方面也匹配。所以基本上,我只需从我的webpack依赖项中去掉^
。
英文:
For me I had
@nrwl/webpack": "^15.0.13"
while all my other packages were without the ^ so like
"@nrwl/webpack": "15.0.13"
Which the migrations thing did identify but didn't fix, so anyway check that your versions match not only in number but also in versioning scheme or whatever this is called
so basically i just had to remove the ^ from my webpack dep
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论