Hey all,
I tried with npm install serve --s and replacing my scripts in package.json, but when tested both on my local machine and heroku while run npm run start, after build, I got an error:
npm install serve --s
npm run start
serve -s build (node:25496) ExperimentalWarning: The ESM module loader is experimental. file:///D:/Projects/Projects-on-React/my-portfolio-website/node_modules/serve/build/main.js:129 url.port = url.port ?? "3000"; ^ SyntaxError: Unexpected token '?'
However, if I run it manualy by typing serve -s build it works, but it uses an old version of serve@^6.14.6
serve -s build
I tried to install this verion and deploy to heroku but it's saying that there is no such a verion.
Any thoughts on what it could be, and maybe how I can solve this?
Thanks in advance!
My pachage.json:
{ "name": "my-portfolio-website", "version": "0.1.0", "private": true, "engines": { "node": "v12.18.3" }, "description": "Iliyan Yordanov portfolio website.", "author": { "name": "Iliyan Yordanov", "email": "iliyanyyordanov@gmail.com" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.32", "@fortawesome/free-brands-svg-icons": "^5.15.1", "@fortawesome/free-regular-svg-icons": "^5.15.1", "@fortawesome/free-solid-svg-icons": "^5.15.1", "@fortawesome/react-fontawesome": "^0.1.11", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", "ansi-regex": "^6.0.1", "axios": "^0.20.0", "bootstrap": "^4.5.3", "joi-browser": "^13.4.0", "jquery": "^3.5.1", "node-sass": "^4.14.1", "popper.js": "^1.16.1", "react": "^16.14.0", "react-dom": "^16.14.0", "react-helmet": "^6.1.0", "react-image-appear": "^1.3.26", "react-mail-form": "^2.1.0", "react-router-dom": "^5.2.0", "react-scripts": "3.4.3", "react-snapshot": "^1.3.0", "react-toastify": "^6.0.9", "serve": "^14.0.0" }, "scripts": { "dev": "react-scripts start", "start": "serve -s build", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", "heroku-postbuild": "npm run build" }, "eslintConfig": { "extends": "react-app" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey all,
I tried with
npm install serve --sand replacing my scripts in package.json, but when tested both on my local machine and heroku while runnpm run start, after build, I got an error:However, if I run it manualy by typing
serve -s buildit works, but it uses an old version of serve@^6.14.6I tried to install this verion and deploy to heroku but it's saying that there is no such a verion.
Any thoughts on what it could be, and maybe how I can solve this?
Thanks in advance!
My pachage.json: