I have been trying to make this React App, but when I try to do yarn start it shows the following error message:
yarn run v1.22.17
$ react-scripts start
node:internal/modules/cjs/loader:488
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /home/abhishek/Documents/Code/weather-react/weather-react/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/abhishek/Documents/Code/weather-react/weather-react/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v17.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
How do I fix this?
This is what it shows now:
Starting the development server...
/home/abhishek/Documents/Code/weather-react/weather-react/node_modules/react-scripts/scripts/start.js:19
throw err;
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (/home/abhishek/Documents/Code/weather-react/weather-react/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/abhishek/Documents/Code/weather-react/weather-react/node_modules/webpack/lib/NormalModule.js:417:16)
at /home/abhishek/Documents/Code/weather-react/weather-react/node_modules/webpack/lib/NormalModule.js:452:10
at /home/abhishek/Documents/Code/weather-react/weather-react/node_modules/webpack/lib/NormalModule.js:323:13
at /home/abhishek/Documents/Code/weather-react/weather-react/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /home/abhishek/Documents/Code/weather-react/weather-react/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/home/abhishek/Documents/Code/weather-react/weather-react/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at /home/abhishek/Documents/Code/weather-react/weather-react/node_modules/babel-loader/lib/index.js:59:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v17.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
removed /node_modules and yarn.lock file.
2.then reinstalled deleted packages/file using yarn install .
Fixed! Downgraded to node 16.13.1 :)
Related
I encountered this problem when creating a new React application (after executing the npx create-react-app my-app command):
➤ YN0000: ┌ Resolution step
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
_r [RequestError]: read ECONNRESET
at ClientRequest.<anonymous> (/home/aldaspan/.yarn/releases/yarn-3.1.1.cjs:154:14361)
at Object.onceWrapper (node:events:510:26)
at ClientRequest.emit (node:events:402:35)
at ClientRequest.o.emit (/home/aldaspan/.yarn/releases/yarn-3.1.1.cjs:149:59453)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:28)
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:211:20) {
code: 'ECONNRESET',
timings: {
start: 1639471914529,
socket: 1639471914529,
lookup: 1639471914530,
connect: 1639471922067,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1639471922468,
abort: undefined,
phases: {
wait: 0,
dns: 1,
tcp: 7537,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 7939
}
}
}
Node.js v17.2.0
Aborting installation.
yarnpkg add --exact react react-dom react-scripts cra-template --cwd /home/aldaspan/galog/react-shop has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
Operating system: Ubuntu 21.10,
Node -v: v17.2.0,
nodejs --version: v12.22.5,
npm -v: 8.1.4
I am new to React, and I have been looking for this problem for several days, but I haven't found a real solution yet.
After lowering the Node (sudo n 16.13.1) version, it prompts other errors:
YN0000: Done with warnings in 5m 4s
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'react-scripts/scripts/init.js'
Require stack:
- /home/aldaspan/react-shop/[eval]
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at [eval]:2:20
at Script.runInThisContext (node:vm:129:12)
at Object.runInThisContext (node:vm:305:38)
at node:internal/process/execution:75:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:74:60) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/aldaspan/react-shop/[eval]' ]
}
Aborting installation.
node has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
First make sure you are using the recommended version of nodejs. And for that you could use the n package from npm:
npm install n -g
n stable
// if one of the above commands does not pass, you could make use of sudo
sudo npm install n -g
sudo n stable
If you have installed globally create-react-app, which you shouldn't since we now use npx,
go ahead and remove it:
npm uninstall -g create-react-app
// if it does not pass, you could make use of sudo
sudo npm uninstall -g create-react-app
After fallowing the above steps, delete the project you attempted to create and start over with:
npx create-react-app my-app
For some reason my npm start doesn't work anymore, cause: this occurred right after switching to some unused branch (with unrelated histories) and pushing any changes (not realizing that this branch was some outdated one), then git checkout -f "" back to the recent branch. Now it doesnt work for any of my branches due to error Error: Cannot find module 'serialize-javascript'
Full error here:
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'serialize-javascript'
Require stack:
- /home/abdullah/ecommerce-recommend-frontend/node_modules/rollup-plugin-terser/index.js
- /home/abdullah/ecommerce-recommend-frontend/node_modules/workbox-build/build/lib/bundle.js
- /home/abdullah/ecommerce-recommend-frontend/node_modules/workbox-webpack-plugin/build/generate-sw.js
- /home/abdullah/ecommerce-recommend-frontend/node_modules/workbox-webpack-plugin/build/index.js
- /home/abdullah/ecommerce-recommend-frontend/node_modules/react-scripts/config/webpack.config.js
- /home/abdullah/ecommerce-recommend-frontend/node_modules/react-scripts/scripts/start.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/home/abdullah/ecommerce-recommend-frontend/node_modules/rollup-plugin-terser/index.js:3:19)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
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 Module.require (internal/modules/cjs/loader.js:952:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/abdullah/ecommerce-recommend-frontend/node_modules/rollup-plugin-terser/index.js',
'/home/abdullah/ecommerce-recommend-frontend/node_modules/workbox-build/build/lib/bundle.js',
'/home/abdullah/ecommerce-recommend-frontend/node_modules/workbox-webpack-plugin/build/generate-sw.js',
'/home/abdullah/ecommerce-recommend-frontend/node_modules/workbox-webpack-plugin/build/index.js',
'/home/abdullah/ecommerce-recommend-frontend/node_modules/react-scripts/config/webpack.config.js',
'/home/abdullah/ecommerce-recommend-frontend/node_modules/react-scripts/scripts/start.js'
]
}
The node_modules/serialize_javascript does exist and has a settings.json file in it:
{
"spellright.language": [
"en"
],
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext",
"javascript"
]
}
I have tried running npm install (with -g as well, and in the node_modules/serialize_javascript dir) with output:
up to date, audited 1725 packages in 2s
130 packages are looking for funding
run `npm fund` for details
1 critical severity vulnerability
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
And npm audit:
# npm audit report
node-serialize *
Severity: critical
Code Execution through IIFE - https://npmjs.com/advisories/311
No fix available
node_modules/node-serialize
1 critical severity vulnerability
Some issues need review, and may require choosing
a different dependency.
What's weird is that even checking node -version (node -v works now after sudo get-apt update) gives a similar MODULE_NOT_FOUND error:
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '/home/abdullah/ecommerce-recommend-frontend/–v'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Note: This only occurred after uninstalling node, then reinstalling in wsl with sudo:
rm -rf /usr/local/lib/node_modules/npm
sudo apt-get remove npm
sudo apt install nodejs
sudo apt-get update
Any ideas? Might try to just get rid of node from windows even though I use WSL and then reinstalling everything
Nevermind, I just copied an old serialize_javascript module from a previous commit since it had more stuff than just the settings.json and ran npm install to get it working.
I am going to use the Ionic framework to work on hybrid app development, so I installed all the necessary dependencies (node.js, cordova, etc.) and followed their Getting started section. Step number 3 simply involves running the following command within the app directory:
> ionic platform add android
However midway during the execution I got the following error:
module.js:341
throw err;
^
Error: Cannot find module 'config-chain'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (C:\Users\james.bonello\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\lib\config\core.js:2:10)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
I ran > npm update first and tried again to see if the update fixes any missing dependencies and such but the problem persisted.
So, as the error clearly states, the module 'config-chain' is missing so I next ran
> npm install config-chain
While that did install the module, the error somehow still persisted (identical to the previous one). I am not sure what to do next and I cannot understand why npm is not recognizing the 'config-chain' module now. Any ideas?
From what I can see, the missing package config-chain is a dependency of the global package cordova.
You should re-install cordova:
npm cache clean
npm uninstall cordova -g
npm install cordova -g
IF the problem persists, you have to manually install the package inside cordova's modules:
C:> cd Users\james.bonello\AppData\Roaming\npm\node_modules\cordova
C:> npm install config-chain
I did npm install and it worked .
How to start a Meteor App with node instead of meteor.
I' ve tried this:
$ meteor create m;
m: created.
To run your new app:
cd m
meteor
$ cd m;
$ meteor;
[[[[[ c:\git\m ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
Type Control-C twice to stop.
# OK! This works :O)
$ node .meteor\local\build\main.js;
module.js:338
throw err;
^
Error: Cannot find module 'fibers'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (c:\git\m\.meteor\local\build\programs\server\boot.js:1:75)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
$ node .meteor\local\build\main.js;
# OK! This does not work :O(
$ cd .meteor\local\build\;
$ npm install fibers;
$ npm install semver;
$ npm install source-map-support;
$ npm install underscore;
$ node main.js
$ c:\git\m\.meteor\local\build\node_modules\fibers\future.js:267
throw(ex);
^
Error: Must pass options.rootUrl or set ROOT_URL in the server environment
at Object.Meteor.absoluteUrl (packages/meteor/url_common.js:21:1)
at Object.WebAppInternals.generateBoilerplate (packages/webapp/webapp_server.js:543:1)
at Object.main (packages/webapp/webapp_server.js:739:1)
at c:\git\m\.meteor\local\build\programs\server\boot.js:255:27
$ set ROOT_URL=localhost:3000;
$ set ROOT_URL;
ROOT_URL=localhost:3000
$ node main.js
c:\git\m\.meteor\local\build\programs\server\boot.js:263
}).run();
^
TypeError: Cannot read property 'slice' of null
at packages/meteor/url_server.js:11:1
at c:\git\m\.meteor\local\build\programs\server\packages\meteor.js:1098:4
at c:\git\m\.meteor\local\build\programs\server\packages\meteor.js:1240:3
at c:\git\m\.meteor\local\build\programs\server\boot.js:222:10
at Function._.each._.forEach (c:\git\m\.meteor\local\build\node_modules\underscore\underscore.js:153:9)
at c:\git\m\.meteor\local\build\programs\server\boot.js:117:5
Maybe it needs more configurations?
You can simply use demeteorizer:
DEMETEORiZER ON GITHUB
After you install it with NPM go to your meteor app catalog and use like:
demeteorizer --output [path]
Then go to the path you have gave in [path] parameter, then:
npm install
Meteor applications make use of the following environment variables:
MONGO_URL='mongodb://user:password#host:port/databasename?autoReconnect=true'
ROOT_URL='http://example.com'
MAIL_URL='smtp://user:password#mailhost:port/' (optional)
PORT=8080 (optional, defaults to 80)
(obviously place your parameters in right places in above)
npm start
I really recommend this sollution. Is simple, works perfect and fast.
I got the error like this while running meanio app using grunt
/home/me/project/myapp/node_modules/meanio/node_modules/q/q.js:126
throw e;
^
Error: Cannot find module 'connect-multiparty'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Module.module.exports (/home/me/project/myapp/packages/contrib/upload/server/routes/meanUpload.js:6:21)
at /home/me/project/myapp/node_modules/meanio/lib/mean.js:286:20
at /home/me/project/myapp/node_modules/meanio/lib/util.js:21:7
at Array.forEach (native)
at walk (/home/me/project/myapp/node_modules/meanio/lib/util.js:16:25)
at /home/me/project/myapp/node_modules/meanio/lib/util.js:23:7
The error might be because of upload package in packages/contrib/upload. In that case just reinstall using mean install command
mean install upload
Open the package.json file of the mentioned package by the error and add the missing module in the dependencies item:
"dependencies": {
"connect-multiparty": "latest",
....
},
Then, run npm install in the package's folder