我在 node-red 项目中使用zeit/pkg时遇到了一些问题。以下是复制问题的步骤:
git clone https://github.com/node-red/node-red.git
cd node-red
npm install
npm run build
在构建命令之后,我将以下内容添加到我的 package.json 文件中:
"pkg": { "assets": [ "./red/**/*" ], "scripts": [ "./red/**/*.js" ] }
运行命令
pkg .
运行后pkg .
出现以下错误:
C:\xampp\htdocs\node-red>pkg .
> pkg@4.3.4
> Targets not specified. Assuming:
node8-linux-x64, node8-macos-x64, node8-win-x64
> Warning Cannot resolve 'path.join(__dirname, '..', '..', 'package.json')'
C:\xampp\htdocs\node-red\red\runtime\index.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
> Warning Cannot resolve ''./' + aSettings.storageModule'
C:\xampp\htdocs\node-red\red\runtime\storage\index.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
> Warning Cannot resolve 'relPath'
C:\xampp\htdocs\node-red\red\runtime\nodes\registry\loader.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
在 pkg 命令之后运行 exe 会给我这个错误:
Node-RED has not been built. See README.md for details
任何帮助将不胜感激。这似乎是一个简单的路径问题,但我似乎无法让它工作。