Package Node-Red using zeit/pkg

769 Views Asked by At

I am having some issues using zeit/pkg on my node-red project. Here are the steps to replicate the issue:

  1. git clone https://github.com/node-red/node-red.git
  2. cd node-red
  3. npm install
  4. npm run build

  5. After build command I added the following to my package.json file:

    "pkg": {
       "assets": [
          "./red/**/*"
       ],
       "scripts": [
          "./red/**/*.js"
       ]
    }
    
  6. Run the command pkg .

After running pkg . I get the following errors:

C:\xampp\htdocs\node-red>pkg .
> [email protected]
> 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.

Running the exe after the pkg command gives me this error: Node-RED has not been built. See README.md for details

Any help would be greatly appreciated. It seems like a simple path issue but I can't seem to get it working.

0

There are 0 best solutions below