Closed PerryFinn closed 2 weeks ago
Computer Configuration Information
node -v # v20.17.0
pnpm -v # 9.9.0
Macbook Pro M2 Pro plasmo: 0.89.2
Steps:
pnpm create plasmo "my-browser-extension" --with-tailwindcss
pnpm install
pnpm dev # error
When I follow the prompt and execute sharp separately, it has the following output:
npm install --ignore-scripts=false --foreground-scripts --verbose sharp
npm verbose cli /Users/goodman/.volta/tools/image/node/20.17.0/bin/node /Users/goodman/.volta/tools/image/node/20.17.0/bin/npm
npm info using npm@10.8.2
npm info using node@v20.17.0
npm verbose title npm install sharp
npm verbose argv "install" "--ignore-scripts" "false" "--foreground-scripts" "--loglevel" "verbose" "sharp"
npm verbose logfile logs-max:10 dir:/Users/goodman/.npm/_logs/2024-09-27T17_48_34_296Z-
npm verbose logfile /Users/goodman/.npm/_logs/2024-09-27T17_48_34_296Z-debug-0.log
npm http fetch GET 200 https://registry.npmmirror.com/sharp 163ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/semver 50ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-darwin-x64 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-darwin-arm64 93ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-linux-arm 94ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-darwin-arm64 94ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/color 97ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-darwin-x64 97ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-linux-arm64 99ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-linux-s390x 54ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-linux-x64 52ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-linuxmusl-arm64 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-linux-arm 56ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-linux-arm64 59ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-linux-x64 58ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-linux-s390x 61ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-linuxmusl-arm64 54ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/detect-libc 165ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-linuxmusl-x64 52ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-libvips-linuxmusl-x64 79ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-win32-x64 51ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-win32-ia32 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmmirror.com/@img%2fsharp-wasm32 61ms (cache revalidated)
npm verbose stack TypeError: Cannot read properties of null (reading 'name')
npm verbose stack at Node.matches (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1111:14)
npm verbose stack at Link.matches (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1117:41)
npm verbose stack at Link.canDedupe (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1071:15)
npm verbose stack at PlaceDep.pruneDedupable (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:426:14)
npm verbose stack at new PlaceDep (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:278:14)
npm verbose stack at #buildDepStep (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:917:18)
npm verbose stack at async Arborist.buildIdealTree (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:181:7)
npm verbose stack at async Promise.all (index 1)
npm verbose stack at async Arborist.reify (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
npm verbose stack at async Install.exec (/Users/goodman/.volta/tools/image/node/20.17.0/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error Cannot read properties of null (reading 'name')
npm verbose cwd /Users/goodman/Desktop/my-workspace/my-browser-extension
npm verbose os Darwin 23.5.0
npm verbose node v20.17.0
npm verbose npm v10.8.2
npm verbose exit 1
npm verbose code 1
npm error A complete log of this run can be found in: /Users/goodman/.npm/_logs/2024-09-27T17_48_34_296Z-debug-0.log
I found the following possibly related issues, but they are either closed or haven't been addressed for a long time. Is this intentional?
https://github.com/PlasmoHQ/plasmo/issues/176 https://github.com/PlasmoHQ/plasmo/issues/870
This error is caused by "sharp module doesn't have build directory". Type "pnpm rebuild sharp@0.32.6 -r" in your terminal will solve this issue.
I had the same problem
This error is caused by "sharp module doesn't have build directory". Type "pnpm rebuild sharp@0.32.6 -r" in your terminal will solve this issue.
I resolved this issue after restarting a project using the CLI. You can try this suggestion, and if it works, I will close this issue.
This error is caused by "sharp module doesn't have build directory". Type "pnpm rebuild sharp@0.32.6 -r" in your terminal will solve this issue.
I resolved this issue after restarting a project using the CLI. You can try this suggestion, and if it works, I will close this issue.
do you mean pnpm create plasmo?
Yes, you just need to recreate a project according to the document.
Of course, I recommend solving practical problems rather than avoiding them in this way.
Yes, you just need to recreate a project according to the document.
Of course, I recommend solving practical problems rather than avoiding them in this way.
Then, why you got the sharp error at the first time?
I also cannot accurately determine the cause, possibly due to my use of Volta for Node version management, but since Volta and pnpm are still incompatible, this situation might lead to such errors.
In my description, you can see the phenomenon where the Node version printed after pnpm execution does not match my global Node version.
This error is caused by "sharp module doesn't have build directory". Type "pnpm rebuild sharp@0.32.6 -r" in your terminal will solve this issue.
I'm so grateful. I've solved the problem using this method.
What happened?
I tried to initialize a new project by following the commands on the official website, but when running
pnpm dev
, an error was reported that prevented the project from starting properly.Expect results: At least be able to start the project properly, which is a big blow for someone new to this framework.
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
No response
Relevant log output
(OPTIONAL) Contribution
Code of Conduct