I tried several times to deploy the website with netlify, but it keeps failing.
Namely I get this error:
parcel build index.html
/opt/build/repo/images/logo.svg: Invalid Version: undefined
I even tried other solutions like:
At the end I tried a combination of the above.
- Install [email protected] (not 1.12.4) as a dependency
npm install -D [email protected]
In that way you will have this:
"devDependencies": {
"parcel-bundler": "^1.12.3"
}
in your package.json
1b. Also add this
"build": "parcel build index.html",
in your scripts
of your package.json
-
Install
[email protected]
also globally (so later, the commandparcel build index.html
in netlify, will be valid).
sudo npm -i -g [email protected]
-
Delete the dist folder (we have double files) and run
parcel build index.html
again. -
Add
node_modules
anddist
to.gitignore
. -
Make a commit and push it to github.
Then follow along the instructor to deploy in netlify.
For the time being I’m not sure if all the steps above are required.
Maybe just installing parcel @1.12.3 globally would be enough.
Or maybe installing the aforementioned version as a dependency and then in netlify use npm or npx in front of the command, like npm parcel build index.html
could also be enough.
Anyway happy coding!
Thanks