create-expo-stack throwing errors after installing any additional package
Revaycolizer opened this issue · comments
When i add any package in the newly initialized project and run it i keep running into this error
(node:14888) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
D:\project\my-ts\nova-music\node_modules\wrap-ansi\index.js:2
const stringWidth = require('string-width');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\project\my-ts\nova-music\node_modules\string-width\index.js from D:\project\my-ts\nova-music\node_modules\wrap-ansi\index.js not supported.
Instead change the require of D:\project\my-ts\nova-music\node_modules\string-width\index.js in D:\project\my-ts\nova-music\node_modules\wrap-ansi\index.js to a dynamic import() which is available in all CommonJS modules.
at Object. (D:\project\my-ts\nova-music\node_modules\wrap-ansi\index.js:2:21)
at Object. (D:\project\my-ts\nova-music\node_modules@expo\cli\build\src\start\doctor\dependencies\ensureDependenciesAsync.js:9:40) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v21.1.0
will try to look into this today, can you specify exactly which library you were trying to install?
Please see this comment where I added the axios
library to an expo router app created with create-expo-stack and did not run into this issue. Closing this until a proper repro is provided.
will try to look into this today, can you specify exactly which library you were trying to install?
i started with axios it did the same, i thought maybe axios files are conflicting with the node modules , then i started a fresh repo then added expo-av it produced the same error, then again i started a fresh repo and added another package recat-native-sound-player and it produced the same error, i cannot add any library so far
Can you please share the output of running create expo stack, the instructions for adding whichever library, and the error that you get? I'm unable to reproduce your issue.