$ npm run start
ismailalabou.github.io@0.1.0 start C:\Users\ismailalabou\Documents\Gitlab\portfolio
node src/index.js
(node:10340) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ...
to show where the warning was created)
C:\Users\ismailalabou\Documents\Gitlab\portfolio\src\index.js:1
import React from "react";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint as runMain
at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ismailalabou.github.io@0.1.0 start: node src/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ismailalabou.github.io@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ismailalabou\AppData\Roaming\npm-cache_logs\2020-12-20T11_10_28_952Z-debug.log
Top comments (8)
Hi,
Add
in your package.json
it's there ...
it's already there it says: Module 'type is extraneous npm [10, 3]'
here are the related docs:
developer.mozilla.org/en-US/docs/W...
it's there ...
"version": "0.1.0",
"private": true,
"type": "module",
"engines": {
"node": "14.15.0",
"npm": "6.14.8"
},
it's already there it says: Module 'type is extraneous npm [10, 3]'
help me solve this <3