Repository navigation
Closed
Labels
🐞 bugSomething isn't working
Description
Self Checks
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- Please do not modify this template :) and fill in all the required fields.
Dify version
0.6.11
Cloud or Self Hosted
Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
my os :Linux iZuf6fksh2blifag87jb4pZ 4.18.0-80.11.2.el8_0.x86_64 #1 SMP Tue Sep 24 11:32:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I use 'Start with Local Source Code',but npm install is error.
✔️ Expected Behavior
11
❌ Actual Behavior
(base) [root@iZuf6fksh2blifag87jb4pZ web]# npm install
npm WARN deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@14.2.4 (node_modules/next/node_modules/@next/swc-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@14.2.4: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-gnu@14.2.4 (node_modules/next/node_modules/@next/swc-linux-arm64-gnu):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-gnu@14.2.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-x64@14.2.4 (node_modules/next/node_modules/@next/swc-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-x64@14.2.4: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-musl@14.2.4 (node_modules/next/node_modules/@next/swc-linux-arm64-musl):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-musl@14.2.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-arm64-msvc@14.2.4 (node_modules/next/node_modules/@next/swc-win32-arm64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-arm64-msvc@14.2.4: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-ia32-msvc@14.2.4 (node_modules/next/node_modules/@next/swc-win32-ia32-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-ia32-msvc@14.2.4: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-x64-msvc@14.2.4 (node_modules/next/node_modules/@next/swc-win32-x64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-x64-msvc@14.2.4: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-darwin-arm64@0.33.4 (node_modules/sharp/node_modules/@img/sharp-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-darwin-arm64@0.33.4: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-darwin-x64@0.33.4 (node_modules/sharp/node_modules/@img/sharp-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-darwin-x64@0.33.4: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-libvips-darwin-x64@1.0.2 (node_modules/sharp/node_modules/@img/sharp-libvips-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-libvips-darwin-x64@1.0.2: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-libvips-linux-arm@1.0.2 (node_modules/sharp/node_modules/@img/sharp-libvips-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-libvips-linux-arm@1.0.2: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-libvips-darwin-arm64@1.0.2 (node_modules/sharp/node_modules/@img/sharp-libvips-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-libvips-darwin-arm64@1.0.2: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-libvips-linux-arm64@1.0.2 (node_modules/sharp/node_modules/@img/sharp-libvips-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-libvips-linux-arm64@1.0.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-libvips-linux-s390x@1.0.2 (node_modules/sharp/node_modules/@img/sharp-libvips-linux-s390x):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-libvips-linux-s390x@1.0.2: wanted {"os":"linux","arch":"s390x"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-libvips-linuxmusl-arm64@1.0.2 (node_modules/sharp/node_modules/@img/sharp-libvips-linuxmusl-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-libvips-linuxmusl-arm64@1.0.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-linux-arm@0.33.4 (node_modules/sharp/node_modules/@img/sharp-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-linux-arm@0.33.4: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-linux-arm64@0.33.4 (node_modules/sharp/node_modules/@img/sharp-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-linux-arm64@0.33.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-linux-s390x@0.33.4 (node_modules/sharp/node_modules/@img/sharp-linux-s390x):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-linux-s390x@0.33.4: wanted {"os":"linux","arch":"s390x"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-linuxmusl-arm64@0.33.4 (node_modules/sharp/node_modules/@img/sharp-linuxmusl-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-linuxmusl-arm64@0.33.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-wasm32@0.33.4 (node_modules/sharp/node_modules/@img/sharp-wasm32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-wasm32@0.33.4: wanted {"os":"any","arch":"wasm32"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-win32-ia32@0.33.4 (node_modules/sharp/node_modules/@img/sharp-win32-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-win32-ia32@0.33.4: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @img/sharp-win32-x64@0.33.4 (node_modules/sharp/node_modules/@img/sharp-win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @img/sharp-win32-x64@0.33.4: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm ERR! Invalid dependency type requested: alias
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2024-06-26T16_28_18_480Z-debug.log
3921 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
3922 verbose stack Error: Invalid dependency type requested: alias
3922 verbose stack at getFetcher (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/pacote/lib/fetch.js:68:15)
3922 verbose stack at manifest (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/pacote/lib/fetch.js:15:19)
3922 verbose stack at pinflight (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/pacote/manifest.js:24:12)
3922 verbose stack at /server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:29:24
3922 verbose stack at Promise._execute (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/debuggability.js:303:9)
3922 verbose stack at Promise._resolveFromExecutor (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:483:18)
3922 verbose stack at new Promise (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:79:10)
3922 verbose stack at _inflight (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:28:25)
3922 verbose stack at /server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:22:14
3922 verbose stack at tryCatcher (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
3922 verbose stack at Promise._settlePromiseFromHandler (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
3922 verbose stack at Promise._settlePromise (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
3922 verbose stack at Promise._settlePromiseCtx (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:606:10)
3922 verbose stack at Async._drainQueue (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
3922 verbose stack at Async._drainQueues (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
3922 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (/server/node/node-v10.9.0-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
3923 verbose cwd /docker/dify-main/web
3924 verbose Linux 4.18.0-80.11.2.el8_0.x86_64
3925 verbose argv "/server/node/node-v10.9.0-linux-x64/bin/node" "/server/node/node-v10.9.0-linux-x64/bin/npm" "install"
3926 verbose node v10.9.0
3927 verbose npm v6.2.0
3928 error Invalid dependency type requested: alias
3929 verbose exit [ 1, true ]
Reacted by dosubot
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't working
Activity
dosubot commentedon Jun 26, 2024
Hello @ganggangtian! I'm here to assist you with any bugs, questions, or contributions you may have. I can help you solve bugs, answer questions, and even guide you to become a contributor. Let me know how I can assist you with the npm install error.
To resolve the "Invalid dependency type requested: alias" error and successfully install the dependencies for Dify version 0.6.11 on your Linux system, follow these steps:
Ensure Node.js Version Compatibility: Make sure you are using Node.js version
>=18.17.0as specified in theenginesfield of thepackage.json.Update npm: Ensure you have the latest version of npm installed. You can update npm using the following command:
Clear npm Cache: Sometimes, clearing the npm cache can resolve dependency issues. Run the following command:
Install Dependencies: Try installing the dependencies again using the following command:
These steps should help resolve the issue [1].
To continue talking to Dosu, mention @dosu.
ganggangtian commentedon Jun 26, 2024
@dosu, npm install version is 20 now,and also error:
(base) [root@iZuf6fksh2blifag87jb4pZ web]# npm install
fatal: not a git repository (or any of the parent directories): .git
husky - git command not found, skipping install
added 3 packages in 7s
361 packages are looking for funding

run
npm fundfor details(base) [root@iZuf6fksh2blifag87jb4pZ web]# npm fund
dosubot commentedon Jun 26, 2024
To resolve the issue where Husky is unable to find the
.gitdirectory when runningnpm install, you can modify thepreparescript in thepackage.jsonfile. The currentpreparescript is:This script changes the directory to the parent directory and then checks if the
NODE_ENVis not 'production'. If it is not 'production', it exits with a status of 1; otherwise, it attempts to install Husky hooks.To ensure Husky can find the
.gitdirectory, you should modify thepreparescript to:This script will run the Husky installation command in the current directory, assuming the
.gitdirectory is in the root of your project.Here is the updated
package.jsonsnippet:This should resolve the issue with Husky not being able to find the
.gitdirectory [1].To continue talking to Dosu, mention @dosu.
ganggangtian commentedon Jun 26, 2024
@dosu, i modify the package.json,but still error:
(base) [root@iZuf6fksh2blifag87jb4pZ web]# head -n 20 package.json
{
"name": "dify-web",
"version": "0.6.11",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public && cross-env PORT=$npm_config_port HOSTNAME=$npm_config_host node .next/standalone/server.js",
"lint": "next lint",
"fix": "next lint --fix",
"eslint-fix": "eslint --fix",
"prepare": "node -e "if (process.env.NODE_ENV !== 'production'){process.exit(1)} " || husky install",
"gen-icons": "node ./app/components/base/icons/script.js",
"uglify-embed": "node ./bin/uglify-embed",
"check-i18n": "node ./i18n/script.js"
},
"dependencies": {
"@babel/runtime": "^7.22.3",
"@dagrejs/dagre": "^1.1.2",
"@emoji-mart/data": "^1.1.2",
(base) [root@iZuf6fksh2blifag87jb4pZ web]# npm install
fatal: not a git repository (or any of the parent directories): .git
husky - git command not found, skipping install
up to date in 2s
361 packages are looking for funding
run
npm fundfor detailsdosubot commentedon Jun 26, 2024
The error message indicates that the
.gitdirectory is not found, which is necessary for Husky to install its hooks. Here are a few steps to troubleshoot and resolve this issue:Ensure Git is Installed: Verify that Git is installed on your system and accessible from the command line. You can check this by running:
If Git is not installed, you can install it using your package manager. For example, on a Debian-based system, you can use:
Initialize a Git Repository: If your project directory is not already a Git repository, you need to initialize it. Navigate to the root of your project and run:
Check the
.gitDirectory: Ensure that the.gitdirectory exists in the root of your project. If it does not, initializing the repository as mentioned above should create it.Verify the
prepareScript: Ensure that thepreparescript in yourpackage.jsonis correctly modified as follows:After performing these steps, try running
npm installagain. This should resolve the issue with Husky not being able to find the.gitdirectory.To continue talking to Dosu, mention @dosu.
crazywoola commentedon Jun 27, 2024
Try to remove the node_modules folder and package-json.lock and run
npm installagain. Make sure node version is 20.x. This is a general frontend package manager issue, please google it before opening a issue, don't forget to use proper markdown syntax to format the code as well. :)ganggangtian commentedon Jun 28, 2024
@dosu,it is ok,sucess to build.tks~
yumu7777777 commentedon Mar 6, 2025
Mingxiangyu commentedon Nov 27, 2025
npm run start 失败是因为这个命令是Linux下的,win上没有,你只能使用run dev ,dev模式下每个页面都需要加载,所以打开新页面后会卡顿,第二次进页面就不卡顿了