You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(node:66799) 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)
/home/alessandro/.yarn/berry/cache/create-svelte-npm-2.0.0-next.71-3c988c4861-7.zip/node_modules/create-svelte/bin.js:2
import fs from 'fs';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:355:18)
at wrapSafe (node:internal/modules/cjs/loader:1039:15)
at Module._compile (node:internal/modules/cjs/loader:1073:27)
at Object.Module.extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.external_module.Module._load (/tmp/xfs-14e6a52a/dlx-66788/.pnp.js:4968:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
Severity
I have found a workaround and I can still use npm, so low.
Additional context
I found a workaround: searching on stackoverflow I found a related question and somewhere else (I don't remember where, most likely in yarn documentation) I get the second bit of the equation and the two things together made the command working:
add immediately a package.json
{
"type": "module"
}
add the following line in .yarnrc.yml
nodeLinker: "node-modules"
I actually don't know how bad is what I'm doing, it looks to me that I'm able to revert the two tricks right after, and I hope the thing should not be incompatible overall. But I just know this way it's running, and doing what expected.
The text was updated successfully, but these errors were encountered:
Sorry to have opened another PR, keep searching I even found an older issue #993, unfortunately I just found workarounds before the disclaimer... (at least the former workaround fully works at the time of writing)
I will follow the advice and drop yarn for svelte.
Describe the bug
I was not able to initialize with
yarn
, i.e. the commandyarn create svelte@next foo
is failing.To Reproduce
yarn
: 2.4.1node
: v16.1.0Then run
yarn create svelte@next foo
.Expected behavior
Initialize the same way of
npm init svelte@next foo
Stacktraces
yarn output
Severity
I have found a workaround and I can still use
npm
, so low.Additional context
I found a workaround: searching on stackoverflow I found a related question and somewhere else (I don't remember where, most likely in yarn documentation) I get the second bit of the equation and the two things together made the command working:
package.json
.yarnrc.yml
I actually don't know how bad is what I'm doing, it looks to me that I'm able to revert the two tricks right after, and I hope the thing should not be incompatible overall. But I just know this way it's running, and doing what expected.
The text was updated successfully, but these errors were encountered: