Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
440 views
in Technique[技术] by (71.8m points)

node.js - 为什么突然出现错误“找不到gulpfile”? 前几天在工作(Why suddenly got the error “No gulpfile found”? Was working a few days ago)

I am using Mac, and using gulp with node.js.

(我正在使用Mac,并将gulp与node.js一起使用。)

A few days ago, it was all working (compiled to CSS) when I typed "gulp sass"/ "gulp sass:watch", but suddenly today, I got the error message of "No Gulpfile Found" as I typed the same command, "gulp sass".

(几天前,当我键入“ gulp sass” /“ gulp sass:watch”时,一切正常(编译为CSS),但是今天突然,当我键入相同的命令时,出现了错误消息“找不到Gulpfile” ,“大嘴”。)

I thought the gulp might be upgraded lately, and installed "gulp" again with "npm i -D gulp", but it hasn't changed anything.

(我以为gulp可能会在最近进行升级,并用“ npm i -D gulp”再次安装“ gulp”,但是它没有任何改变。)

I've just started learning programming a month ago, so forgive me not making a good question.

(我一个月前才刚刚开始学习编程,所以请原谅我提出的问题不是很好。)

These are files I've got in my project file:

(这些是我在项目文件中拥有的文件:)

  • gulpfile.js

    (gulpfile.js)

  • package-lock.json

    (package-lock.json)

  • package.json

    (package.json)

  • node_modules

    (node_modules)

  • sass

    (ass)

I appreciate your kind answers.

(非常感谢您的回答。)

  ask by Sanae translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Let's say you have a project named my-project and a package.json file is in your project directory.

(假设您有一个名为my-project的项目,而package.json文件位于项目目录中。)

This is the same directory that contains a package.json file and is mentioned at the end of your question.

(这是一个包含package.json文件的目录,在问题末尾提到。)

You got a No Gulpfile Found error message when trying to run the gulp sass command.

(尝试运行No Gulpfile Found gulp sass命令时收到“ No Gulpfile Found错误消息。)

Make sure that you have changed directories with cd to this project directory before running gulp sass .

(运行gulp sass之前,请确保已将cd目录更改为该项目目录。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...