index.js: Invalid Version: undefined

🐛 bug report

npm install -g parcel-bundler

created index.html which includes index.js to test parcel

running parcel index.html throws error
Invalid Version: undefined

geegee@geegee-B450M-GAMING:~/mk-projects/parcel-demo$ parcel index.html
Server running at http://localhost:33119 – configured port 1234 could not be used.
🚨 /home/geegee/mk-projects/parcel-demo/index.js: Invalid Version: undefined
at new SemVer (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/node_modules/@babel/preset-env/node_modules/semver/semver.js:314:11)
at compare (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/node_modules/@babel/preset-env/node_modules/semver/semver.js:647:10)
at lt (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/node_modules/@babel/preset-env/node_modules/semver/semver.js:688:10)
at /home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/node_modules/@babel/preset-env/lib/index.js:276:22
at Object.default (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/node_modules/@babel/helper-plugin-utils/lib/index.js:22:12)
at getEnvPlugins (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/src/transforms/babel/env.js:62:34)
at getEnvConfig (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/src/transforms/babel/env.js:12:25)
at async getBabelConfig (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/src/transforms/babel/config.js:32:19)
at async babelTransform (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/src/transforms/babel/transform.js:6:16)
at async JSAsset.pretransform (/home/geegee/.nvm/versions/node/v15.3.0/lib/node_modules/parcel-bundler/src/assets/JSAsset.js:83:5)

🎛 Configuration (.babelrc, package.json, cli command)

{
  "name": "parcel-demo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

🤔 Expected Behavior

😯 Current Behavior

💁 Possible Solution

🔦 Context

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 1.12.4
Node 15.3.0n
npm/Yarn 7.5.3
Operating System linux

1 possible answer(s) on “index.js: Invalid Version: undefined

  1. Had the same issue. Must be something with the version because I manually installed the previous version and now it works:

    npm uninstall -g parcel-bundler
    npm install -g parcel-bundler@1.12.3