6

I am trying to create a bundle for openlayers. I have followed the tutorial https://openlayers.org/en/latest/doc/tutorials/bundle.html When I get to npm run build I get the following error.

[email protected] build /accounts/linuxuser/web_projects/openmap
parcel build --public-url . index.html
sh: parcel: command not found

When I ls the node_modules folder I get. parcel -> ../parcel-bundler/bin/cli.js. When I cd to the node_modules folder the parcel-bundler folder is not found. When I run npm install --save-dev parcel-bundler I get the following.

  [email protected] install /accounts/linuxuser/web_projects/openmap/node_modules/deasync
  node ./build.js
  sh: node: command not found
  [email protected] /accounts/linuxuser/web_projects/openmap

I do have npm install.

npm --version
3.5.2

Error after running npm install --save-dev parcel-bundler

 WARN engine [email protected]: wanted: {"node":">= 6.0.0"} (current: {"node":"4.2.6","npm":"3.5.2"})

 [email protected] install /accounts/linuxuser/web_projects/openmap/node_modules/deasync
 node ./build.js

 sh: node: command not found
 [email protected] /accounts/linuxuser/web_projects/openmap
 └── [email protected]  extraneous

 npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
 npm WARN notsup Not compatible with your operating system or architecture: [email protected]
 npm WARN [email protected] No description
 npm WARN [email protected] No repository field.
 npm ERR! Linux 4.4.0-154-generic
 npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "parcel-bundler"
 npm ERR! node v4.2.6
 npm ERR! npm  v3.5.2
 npm ERR! file sh
 npm ERR! code ELIFECYCLE
 npm ERR! errno ENOENT
 npm ERR! syscall spawn

 npm ERR! [email protected] install: `node ./build.js`
 npm ERR! spawn ENOENT
 npm ERR! 
 npm ERR! Failed at the [email protected] install script 'node ./build.js'.

 pm ERR! Make sure you have the latest version of node.js and npm installed.
 npm ERR! If you do, this is most likely a problem with the deasync package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR!     node ./build.js
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR!     npm bugs deasync
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR!     npm owner ls deasync
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR!     /accounts/linuxuser/web_projects/openmap/npm-debug.log

The folder structure is

   openmap/
       index.html
       index.js
       package.json
       node_modules/
5
  • "npm install --save parcel-bundler" - remove that dev from your command and run it and after that run "npm run build" Commented Aug 21, 2019 at 10:59
  • did you install node first ?please print the ouput of "node -v" here Commented Aug 21, 2019 at 11:02
  • I used the npm install --save parcel-bundler command and received the same result. Yes I have node installed nodejs -v outputs v4.2.6 I have to use nodejs because I am using ubuntu Commented Aug 21, 2019 at 12:38
  • so in your package.json -> inside scripts -> build -> instead of node use nodejs Commented Aug 21, 2019 at 12:46
  • Here is the build line. "build": "parcel build --public-url . index.html" Commented Aug 22, 2019 at 12:03

1 Answer 1

2

In my case I was running it wrongly, it is suppossed ot be run with either of these commands:

npx parcel ...
yarn parcel ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.