包裹错误 - 找不到模块 @parcel\fs-search\fs-search.win32-x64-msvc.node
Parcel Error - module not found @parcel\fs-search\fs-search.win32-x64-msvc.node
我最近将 windows 从 windows 10 更新到 11。
** 更新 ** 我重新安装了 windows 10,但我收到了同样的错误
当我运行 yarn start 或 npm start 时,我收到以下错误
λ yarn start
yarn run v1.22.15
$ parcel index.html
Error: The specified module could not be found.
\?\C:\Users\Ammar Home\Desktop\testing\node_modules\@parcel\fs-search\fs-search.win32-x64-msvc.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (C:\Users\Ammar Home\Desktop\testing\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (C:\Users\Ammar Home\Desktop\testing\node_modules\@parcel\fs-search\index.js:19:20)
at Module._compile (C:\Users\Ammar Home\Desktop\testing\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
code: 'ERR_DLOPEN_FAILED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我的设置非常简单,这里是详细信息
package.json 文件
{
"name": "testing",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"start": "parcel index.html",
"build": "parcel build"
},
"devDependencies": {
"parcel": "^2.0.0"
}
}
我的 index.html 或 javascript 文件没有什么特别的,
html 文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script src="./index.js" type="module"></script>
</body>
</html>
javascript 文件
console.log("Hello world");
我的环境
Parcel 2
Node v14.18.1
npm/Yarn
Operating System Windows 11 Pro
Version 21H2
OS build 22000.258
experience Windows Feature Experience Pack 1000.22000.258.0
实验室规格
Processor Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz 1.80 GHz
Installed RAM 8.00 GB (7.88 GB usable)
System type 64-bit operating system, x64-based processor
奇怪的是,当我查看错误中指定的文件夹时,我发现模块“fs-search.win32-x64-msvc.node”,它已经在以下目录下
node_moduels/@parcel/fs-search /fs-search.win32-x64-msvc.node
已经存在,但是报错找不到!
我删除了node_modules几次,然后又重新安装了parcel,但是还是出现了同样的错误,
我不确定是什么导致了这个问题,
有人可以帮忙吗?
调试日志
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.14.15
3 info using node@v14.18.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle testing@1.0.0~prestart: testing@1.0.0
6 info lifecycle testing@1.0.0~start: testing@1.0.0
7 verbose lifecycle testing@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle testing@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Ammar Home\Desktop\testing\node_modules\.bin;C:\Users\Ammar Home\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Users\Ammar Home\cmder\vendor\conemu-maximus5;C:\Users\Ammar Home\cmder\vendor\conemu-maximus5\ConEmu;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\Ammar Home\AppData\Local\Microsoft\WindowsApps;C:\Users\Ammar Home\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Ammar Home\AppData\Roaming\npm;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Ammar Home\cmder\vendor\bin;C:\Users\Ammar Home\cmder
9 verbose lifecycle testing@1.0.0~start: CWD: C:\Users\Ammar Home\Desktop\testing
10 silly lifecycle testing@1.0.0~start: Args: [ '/d /s /c', 'parcel index.html' ]
11 silly lifecycle testing@1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle testing@1.0.0~start: Failed to exec start script
13 verbose stack Error: testing@1.0.0 start: `parcel index.html`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1058:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
14 verbose pkgid testing@1.0.0
15 verbose cwd C:\Users\Ammar Home\Desktop\testing
16 verbose Windows_NT 10.0.22000
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v14.18.1
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error testing@1.0.0 start: `parcel index.html`
22 error Exit status 1
23 error Failed at the testing@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
我无法用相同的节点和 win10 版本在我这边重现这个。但是,根据this answer (about an unreladed package) the "module could not be found" error can occur when the native module file (which does exist) tries to load a dependency that's not present on the system. You could try using Dependency Walker检查一下你机器上node_moduels/@parcel/fs-search/fs-search.win32-x64-msvc.node
的依赖,看是否都安装好了。
由于计算机上缺少库导致的问题。
fs-search 需要 Microsoft Visual C++ 2015 Redistributable (x64)。
您可以在此处下载 -> https://aka.ms/vs/17/release/vc_redist.x64.exe
我已经从 github 个关于包裹的问题中得到答案
https://github.com/parcel-bundler/parcel/issues/7104
谢谢,
我最近将 windows 从 windows 10 更新到 11。
** 更新 ** 我重新安装了 windows 10,但我收到了同样的错误
当我运行 yarn start 或 npm start 时,我收到以下错误
λ yarn start
yarn run v1.22.15
$ parcel index.html
Error: The specified module could not be found.
\?\C:\Users\Ammar Home\Desktop\testing\node_modules\@parcel\fs-search\fs-search.win32-x64-msvc.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (C:\Users\Ammar Home\Desktop\testing\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (C:\Users\Ammar Home\Desktop\testing\node_modules\@parcel\fs-search\index.js:19:20)
at Module._compile (C:\Users\Ammar Home\Desktop\testing\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
code: 'ERR_DLOPEN_FAILED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我的设置非常简单,这里是详细信息
package.json 文件
{
"name": "testing",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"start": "parcel index.html",
"build": "parcel build"
},
"devDependencies": {
"parcel": "^2.0.0"
}
}
我的 index.html 或 javascript 文件没有什么特别的,
html 文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script src="./index.js" type="module"></script>
</body>
</html>
javascript 文件
console.log("Hello world");
我的环境
Parcel 2
Node v14.18.1
npm/Yarn
Operating System Windows 11 Pro
Version 21H2
OS build 22000.258
experience Windows Feature Experience Pack 1000.22000.258.0
实验室规格
Processor Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz 1.80 GHz
Installed RAM 8.00 GB (7.88 GB usable)
System type 64-bit operating system, x64-based processor
奇怪的是,当我查看错误中指定的文件夹时,我发现模块“fs-search.win32-x64-msvc.node”,它已经在以下目录下
node_moduels/@parcel/fs-search /fs-search.win32-x64-msvc.node
已经存在,但是报错找不到!
我删除了node_modules几次,然后又重新安装了parcel,但是还是出现了同样的错误, 我不确定是什么导致了这个问题, 有人可以帮忙吗?
调试日志
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.14.15
3 info using node@v14.18.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle testing@1.0.0~prestart: testing@1.0.0
6 info lifecycle testing@1.0.0~start: testing@1.0.0
7 verbose lifecycle testing@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle testing@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Ammar Home\Desktop\testing\node_modules\.bin;C:\Users\Ammar Home\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Users\Ammar Home\cmder\vendor\conemu-maximus5;C:\Users\Ammar Home\cmder\vendor\conemu-maximus5\ConEmu;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\Ammar Home\AppData\Local\Microsoft\WindowsApps;C:\Users\Ammar Home\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Ammar Home\AppData\Roaming\npm;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Ammar Home\cmder\vendor\bin;C:\Users\Ammar Home\cmder
9 verbose lifecycle testing@1.0.0~start: CWD: C:\Users\Ammar Home\Desktop\testing
10 silly lifecycle testing@1.0.0~start: Args: [ '/d /s /c', 'parcel index.html' ]
11 silly lifecycle testing@1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle testing@1.0.0~start: Failed to exec start script
13 verbose stack Error: testing@1.0.0 start: `parcel index.html`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1058:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
14 verbose pkgid testing@1.0.0
15 verbose cwd C:\Users\Ammar Home\Desktop\testing
16 verbose Windows_NT 10.0.22000
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v14.18.1
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error testing@1.0.0 start: `parcel index.html`
22 error Exit status 1
23 error Failed at the testing@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
我无法用相同的节点和 win10 版本在我这边重现这个。但是,根据this answer (about an unreladed package) the "module could not be found" error can occur when the native module file (which does exist) tries to load a dependency that's not present on the system. You could try using Dependency Walker检查一下你机器上node_moduels/@parcel/fs-search/fs-search.win32-x64-msvc.node
的依赖,看是否都安装好了。
由于计算机上缺少库导致的问题。 fs-search 需要 Microsoft Visual C++ 2015 Redistributable (x64)。
您可以在此处下载 -> https://aka.ms/vs/17/release/vc_redist.x64.exe
我已经从 github 个关于包裹的问题中得到答案
https://github.com/parcel-bundler/parcel/issues/7104
谢谢,