I installed parcel internally and globally.
I can run parcel scripts globally without problem, like: parcel index.html.
but when i try to run it internally like: npx parcel index.html, I get this error:
At line:1 char:3
+ -- parcel index.html
+ ~
Missing expression after unary operator '--'.
At line:1 char:4
+ -- parcel index.html
+ ~~~~~~
Unexpected token 'parcel' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
This is my package.json file:
{
"name": "first-npm-project",
"version": "1.0.0",
"description": "This is first time that i use npm init feature",
"main": "script.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel index.html",
"build": "parcel build index.html"
},
"author": "Ali",
"license": "ISC",
"dependencies": {
"leaflet": "^1.8.0",
"lodash-es": "^4.17.21"
},
"devDependencies": {
"parcel": "^2.7.0"
}
}
I defined scripts inside package.json file as you can see but when I try to run them like: npm run start, I get the same error and even when I run test from scripts inside package.json i get this error :
At line:1 char:3
+ -- echo "Error: no test specified" && exit 1
+ ~
Missing expression after unary operator '--'.
At line:1 char:4
+ -- echo "Error: no test specified" && exit 1
+ ~~~~
Unexpected token 'echo' in expression or statement.
At line:1 char:36
+ -- echo "Error: no test specified" && exit 1
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator