[英]Is it possible to use the package name in a local package import?
[英]how to import a local js package instead of a network package
我想自定義包含在grand-stack-starter中的默認 apollo-server
為此,我克隆了apollo-server並替換了它(在 grand-stack-starter 中)
import { ApolloServer } from "apollo-server-express";
import { ApolloServer } from "C:/Users/a1ole/Documents/GitHub/apollo-server/packages/apollo-server-express/";
但控制台返回錯誤:“找不到模塊...”
您不應該使用絕對路徑。 如果您移動目錄,它將不再起作用。 這也不適用於除您以外的任何其他人。
而是將您的 apollo-server-express 復制到項目中的 node_modules 文件夾中,然后像使用任何其他模塊一樣導入它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.