So, I've used Parcel multiple times before and I've never had an issue with it.
This time it throws some stupid errors about SemVer versioning and I'm literally loosing my mind trying to find a solution which would fix this problem.
I've started new project: installed npm w/ npm init
(no additional options), then installed parcel npm install --save-dev parcel-bundler
and then created my folder structure:
--node_modules
--index.html
--index.js
Here is my package.json:
{
"name": "playground",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "parcel index.html"
},
"author": "",
"license": "ISC",
"devDependencies": {
"parcel-bundler": "^1.12.4"
}
}
I've configured default npm script to run parcel: "dev": "parcel index.html"
and run it.
Everything works fine, however when I connect my index.js in index.html via <script src="/index.js"></script>
it throws big fat error, saying:
D:workingSpaceplaygroundindex.js: Invalid Version: undefined
at new SemVer (D:workingSpaceplayground
ode_modules@babelpreset-env
ode_modulessemversemver.js:314:11)
at compare (D:workingSpaceplayground
ode_modules@babelpreset-env
ode_modulessemversemver.js:647:10)
at lt (D:workingSpaceplayground
ode_modules@babelpreset-env
ode_modulessemversemver.js:688:10)
at D:workingSpaceplayground
[email protected]:276:22
at Object.default (D:workingSpaceplayground
[email protected]:22:12)
at getEnvPlugins (D:workingSpaceplayground
ode_modulesparcel-bundlersrcransformsabelenv.js:62:34)
at getEnvConfig (D:workingSpaceplayground
ode_modulesparcel-bundlersrcransformsabelenv.js:12:25)
at async getBabelConfig (D:workingSpaceplayground
ode_modulesparcel-bundlersrcransformsabelconfig.js:32:19)
at async babelTransform (D:workingSpaceplayground
ode_modulesparcel-bundlersrcransformsabelransform.js:6:16)
at async JSAsset.pretransform (D:workingSpaceplayground
ode_modulesparcel-bundlersrcassetsJSAsset.js:83:5)
Currently I'm using Node v14.6.0 and accordingly it's npm version - 6.14.11
I've never faced this bug before, please help T_T
question from:
https://stackoverflow.com/questions/66459081/parcel-semver-bug 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…